package com.winperturn.apps.swipeytabs;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;

public class NetUtils {
	public static boolean isNetConnected(Context context) {
		try {
			ConnectivityManager connManger = (ConnectivityManager) context
					.getSystemService(Context.CONNECTIVITY_SERVICE);
			if (connManger != null) {
				NetworkInfo netInfo = connManger.getActiveNetworkInfo();
				if (netInfo != null && netInfo.isConnected()) {
					if (netInfo.getState() == NetworkInfo.State.CONNECTED) {
						return true;
					}
				}
			}

		} catch (Exception e) {
			Log.d("NetUtils", e.getMessage());
		}
		return false;
	}
}
